<?php $this->load->view('base/header');?>

<style type="text/css">
*{margin:0}
body{background:url(/misc/images/pbg.jpg) center top no-repeat}
.box{background:url(/misc/images/plogin.jpg);width:558px;height:446px;color:#0048ac; position: relative;margin:101px auto 0 auto;font-size:12px}
.login{ position: absolute;top:160px;left:253px;}
label{margin-right:7px}
.ipt{border:1px solid #b9cae1; padding:1px 3px; background: #fff; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;width:150px}
.ya {
    height:18px;
    line-height:18px;
    border:1px solid #8eaddb;
    width:85px;}
.yo {
    width:145px;
    height:18px;
    border-bottom:1px solid #8eaddb;
    border-right:1px solid #8eaddb;
    border-left:1px solid #8eaddb;
    border-top:1px solid #8eaddb;
    line-height:18px;}
.space {
    font-family:宋体;
}
</style>

<script type="text/javascript">
    function updateCaptcha(obj) {
        $(obj).prev().attr('src', '/cap');
    }

    $(function() {
        $('#loginForm').submit(function() {
            if ($('#uName').val() == '') {
                alert('请输入用户名');
                $('#uName').focus();
                return false;
            }

            if ($('#uPasswd').val() == '') {
                alert('请输入密码');
                $('#uPasswd').focus();
                return false;
            }

            if ($('#captcha').val() == '') {
                alert('请输入密码');
                $('#captcha').focus();
                return false;
            }

            $.post('/login', $(this).serialize(), function(data) {
                if (data.code == 0) {
                    window.location.href = '/';
                } else {
                    if (data.code == 1) {
                        $('#renewCaptcha').prev().attr('src', data.result);
                    }
                    alert(data.message);
                }
            }, 'json');

            return false;
        });

        $('#uName').focus();
    });
</script>
<div class="box">
<form method="post" action="" name="loginForm" id="loginForm">
    <div class="login">
        <div style="margin-top:13px"><label>用户名：</label> <input  name="uName" id="uName" maxlength="18" type="text" class="yo" /></div>
        <div style="margin-top:13px"><label>密　码：</label> <input name="uPasswd"  id="uPasswd" maxlength="18" type="password" class="yo" /></div>
        <div style="margin-top:13px"><label>验证码：</label><label> <input name="captcha" id="captcha" autocomplete="off" maxlength="4" type="text" class="ya" /></label></div>
        <div style="margin-top:13px"><label class="space">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><label style="margin-left:6px;"><?php echo $image;?>&nbsp;&nbsp;<a onclick="updateCaptcha(this);return false" href="javascript:void(0);" id="renewCaptcha">看不清？</a></label></div>
        <div style="margin:20px 0 0 20px"><input type="submit" id="logon" name="logon" value="" style="border:0;background:url(/misc/images/b1.gif);width:78px;height:29px;cursor: pointer;" />　　<input type="button" name="close" id="close"  style="border:0;background:url(/misc/images/b2.gif);width:78px;height:29px;cursor: pointer;" /></div>
    </div>
</form>
</div>

<?php $this->load->view('base/footer');?>
